<template>
  <div id="app">
    <router-view v-if="isRouterAlive" class="view" />
    <loading v-show="isLoading"></loading>
  </div>
</template>
<script>
import loading from "@/components/common/Loading/Index";
export default {
  name: "App",
  provide() {
    return {
      reload: this.reload,
    };
  },
  components: {
    loading,
  },
  data() {
    return {
      isRouterAlive: true,
    };
  },
  computed: {
    isLoading() {
      return this.$store.getters.isLoading;
    },
  },
  methods: {
    reload() {
      this.isRouterAlive = false;
      this.$nextTick(function () {
        this.isRouterAlive = true;
      });
    },
  },
};
</script>

<style lang="scss"></style>
